var url=   "http://jx.xuzhixiang.top/ap/api/allproductlist.php?pagesize=14&pagenum=10";
var xhr=new XMLHttpRequest()
xhr.open("get",url)
xhr.send();
xhr.onload=function(){
  if(xhr.status==200){
    var obj =JSON.parse(xhr.responseText)
    var html=""
      obj.data.forEach((pObj)=> {
          html+=`  <li>
          <img src="${pObj.pimg}">
          <h3>${pObj.pname}</h3> 
          <p>${pObj.pprice}</p>    
          <a class="btn" href="详情页.html?pid=${pObj.pid}">加入购物车</a>
          </li>`
    });var ul=document.querySelector(".ul")
ul.innerHTML=html
  }
}